package jataaka.command;

import jataaka.util.URLCreatorCommandUtils;

import java.util.ArrayList;
import java.util.List;


/**
 * 
 * A generic URL creator command
 * 
 * @author Juan Carlos Cancela
 *
 */
public class GenericURLCreatorCommand implements URLCreatorCommand {
	
	/** the host of the data feeder */
	private String host;
	
	/** the list of inmutable folders to the data source */
	private List<String> immutableFolders = new ArrayList<String>();
	
	/** the list of mutable folders to the data source */
	private List<String> mutableFolders = new ArrayList<String>();
	
	/** the list of inmutable parameters to the data source */
	private List<String> immutableParams = new ArrayList<String>();
	
	/** the list of mutable parameters to the data source */
	private List<String> mutableParams = new ArrayList<String>();

	/**
	 * 
	 * Constructor for a Generic URL creator command
	 * 
	 * @param host the host
	 * @param immutableFolders the inmutableFolders
	 * @param mutableFolders the mutableFolders
	 * @param immutableParams the inmutableParams
	 * @param mutableParams the mutableParams
	 */
	public GenericURLCreatorCommand(String host, List<String> immutableFolders,
			List<String> mutableFolders, List<String> immutableParams,
			List<String> mutableParams) {
		this.host = host;
		this.immutableFolders = immutableFolders;
		this.mutableFolders = mutableFolders;
		this.immutableParams = immutableParams;
		this.mutableParams = mutableParams;
	}

	/** gets the host of the url */
	public String getHost() {
		return host;
	}

	/** gets the list of inmutable folders of the url */
	public List<String> getImmutableFolders() {
		return immutableFolders;
	}

	/** gets the list of mutable folders of the url */
	public List<String> getMutableFolders() {
		return mutableFolders;
	}

	/** gets the list of inmutable params of the url */
	public List<String> getImmutableParams() {
		return immutableParams;
	}
	
	/** gets the list of mutable params of the url */
	public List<String> getMutableParams() {
		return mutableParams;
	}
	
	/** retrieves the list of compositable urls based on the parameters of the command */
	public List<String> retrieveListOfCompositableURLs() {
		return URLCreatorCommandUtils.retrieveBaseCompositableURLs((URLCreatorCommand)this);
	}

}
